package com.sun.showcase.client.vo.order;

import java.util.ArrayList;
import java.util.List;

import javax.validation.constraints.NotNull;

import com.alibaba.fastjson.JSONObject;

public class SaveOrderEntity {
	@NotNull(message="用户ID不能为空")
	private String userId;
	@NotNull(message="用户名不能为空")
	private String userName;
	@NotNull(message="购买商品为空")
	private List<SaveOrderGoodsEntity> goodsList;
	private String payType;
	@NotNull(message="收货地址不能为空")
	private String addressId;
	public static void main(String[] args) {
		SaveOrderEntity s = new SaveOrderEntity();
		s.setUserId("1");
		s.setUserName("Hi");
		s.setPayType("0");
		s.setAddressId("1");
		List<SaveOrderGoodsEntity> goodsList = new ArrayList<SaveOrderGoodsEntity>();
		SaveOrderGoodsEntity g = new SaveOrderGoodsEntity();
		g.setShopId("1");
		g.setShopName("1号铺子");
		List<SaveSkuEntity> skuList = new ArrayList<SaveSkuEntity>();
		g.setSkuList(skuList);
		goodsList.add(g);
		SaveSkuEntity k = new SaveSkuEntity();
		k.setBuyNum(3);
		k.setSkuId("1");
		skuList.add(k);
		g.setSkuList(skuList);
		goodsList.add(g);
		s.setGoodsList(goodsList);
		System.out.print(JSONObject.toJSON(s));
	}
	public String getAddressId() {
		return addressId;
	}

	public void setAddressId(String addressId) {
		this.addressId = addressId;
	}

	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public List<SaveOrderGoodsEntity> getGoodsList() {
		return goodsList;
	}

	public void setGoodsList(List<SaveOrderGoodsEntity> goodsList) {
		this.goodsList = goodsList;
	}
	
	
}
